<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/ezuikit.js}"></script>
    <script src="jquery.min.js"></script>
</head>
<body>
<div id="1">
    <iframe
            src="https://open.ys7.com/ezopen/h5/iframe_se?url=ezopen://HAMKVC@open.ys7.com/F42286931/1.live&autoplay=0&audio=1&accessToken=at.16st2pkc55iv3sked0qczsqmc03yiicr-7efg4hwraj-15ke7xb-0n236xock"
            width=600
            height=480
            id="ysopen"
            allowfullscreen
    >
    </iframe>
</div>
<div >
    <button onClick="play()">开始</button>
    <button onClick="stop()">停止</button>
    <button onClick="openSound()">开启声音</button>
    <button onClick="closeSound()">关闭声音</button>
    <button onClick="capturePicture()">截图</button>
    <button onClick="startSave()">开始录像</button>
    <button onClick="stopSave()">结束录像</button>
    <a th:href="@{/camera}"> <input type=button value="1倍"> </a>
    <a th:href="@{/camera2}"> <input type=button value="1.2倍"> </a>
    <a th:href="@{/camera3}"> <input type=button value="1.5倍"> </a>
</div>
<!--<form id="AT" method="post" th:action="@{/video}" >-->
<!--    AccessToken:<input type="text" name="AT">-->
<!--    <input type="submit" value="提交">-->
<!--</form>-->

<script>
    /* 获取播放器元素 */
    var player = document.getElementById('ysopen').contentWindow;

    function play() {
        player.postMessage("play", "https://open.ys7.com/ezopen/h5/iframe") /* 播放 */
        playPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function stop() {
        player.postMessage("stop", "https://open.ys7.com/ezopen/h5/iframe") /* 结束 */
        stopPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function capturePicture() {
        player.postMessage("capturePicture", "https://open.ys7.com/ezopen/h5/iframe") /* 截图 */
        capturePicturePromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function openSound() {
        player.postMessage("openSound", "https://open.ys7.com/ezopen/h5/iframe") /* 开启声音 */
        openSoundPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function closeSound() {
        player.postMessage("closeSound", "https://open.ys7.com/ezopen/h5/iframe") /* 关闭声音 */
        closeSoundPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function startSave() {
        player.postMessage("startSave", "https://open.ys7.com/ezopen/h5/iframe") /* 开始录制 */
        startSavePromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function stopSave() {
        player.postMessage("stopSave", "https://open.ys7.com/ezopen/h5/iframe") /* 结束录制 */
        stopSavePromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function fullScreen() {
        var fullScreenPromise = playr.fullScreen();
        fullScreenPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }
    function cancelFullScreen() {
        var cancelFullScreenPromise = playr.cancelFullScreen();
        cancelFullScreenPromise.then((data)=>{
            console.log("promise 获取 数据",data)
        })
    }

</script>


</body>
</html>